﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DotNetNuke.Modules.PowerShell.Contexts;

namespace DotNetNuke.Modules.PowerShell.Utils
{
	public class ContextHelper
	{
		public static IShellContext CreateContext(string contextName)
		{
			var contextClass = string.Format("{0}Context", contextName);

			IShellContext context =
					System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("DotNetNuke.Modules.PowerShell.Contexts." +
																					 contextClass, true) as IShellContext;

			return context;
		}
	}
}